Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

type_is_DataType #103

Closed
wants to merge 1 commit into from
Closed

type_is_DataType #103

wants to merge 1 commit into from

Conversation

deanm0000
Copy link
Contributor

noticed that we had

def array(values, type=None,...)

this just makes the type parameter optionally None or DataType

@zen-xu
Copy link
Owner

zen-xu commented Sep 27, 2024

These overloads are aimed at situations where there is no need to modify the values data type

@deanm0000
Copy link
Contributor Author

Yeah but without any overload that accepts something other than None, you can't make an array with a defined type without it complaining

@zen-xu
Copy link
Owner

zen-xu commented Sep 29, 2024

I used Generic _DataTypeT to specify the array type

@overload
def array(
values: Iterable | SupportArrowArray | SupportArrowDeviceArray,
type: _DataTypeT,
mask: Mask | None = None,
size: int | None = None,
from_pandas: bool | None = None,
safe: bool = True,
memory_pool: MemoryPool | None = None,
) -> Array[Scalar[_DataTypeT]]: ...

@deanm0000 deanm0000 closed this Oct 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants